//
//  TGTools.h
//  Customer
//
//  Created by tangang on 2017/8/23.
//  Copyright © 2017年 tangang. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
#import "BaseVM.h"
@interface TGTools : NSObject
///颜色转图片
+ (UIImage *)createImageWithColor:(UIColor*) color;
///获取字符串的宽高
+ (CGSize)boundingRectWithString:(NSString *)string withSize:(CGSize)size anfont:(CGFloat)fontSize;
+ (CGFloat)getSpaceLabelHeight:(NSString*)str withFont:(UIFont*)font withWidth:(CGFloat)width andLineSpacing:(CGFloat)lineSpacing;
///获取字符串的宽
+ (CGFloat)boundingRectWithString:(NSString *)string withWidth:(CGFloat)width anfont:(UIFont *)font;
///字典转json
+ (NSString*)convertToJSONData:(id)infoDict;
///json转字典
+ (NSDictionary *)JsonToDict:(NSString *)strJson;
///检测用户是否打开定位
+ (void)checkOpenGPS:(UIViewController *)viewCtrl;
///截取当前屏幕
+ (UIImage *)getSnapshotImage:(UIViewController *)vc;
///获取当前view的控制器
+ (UIViewController*)viewController:(UIView *)view;
///给视图加圆角
+ (void)setViewFilletWithView:(UIView *)view andHaveBorder:(BOOL)isHave;
///图片下载
+ (void)downloadImageWithUrl:(NSString *)url andSuccess:(void (^) (UIImage  *img))success;
///尺寸转换  压缩为屏幕宽
+ (CGSize)conversionsSize:(CGSize)size;
+ (NSString *)getTime:(int)time;
+ (NSString*) stringWithUUID;

///图片压缩后转base64
+ (NSString *)base64WithImage:(UIImage *)image;

///获取时间转string
+ (NSString *)dateFormatter:(NSString *)strTime andDate:(NSDate *)date;
///string转date
+ (NSDate *)dateFormatter:(NSString *)formatter andString:(NSString *)time;
///获取生肖
+ (NSString *)getShengXiao:(NSString *)digit;
@end
